Repository navigation
V2 follow-ups round 2: enrollment deadline, report-status conflict, DCV domain lookup cache - #41
Merged
Merged
Conversation
…ws through Track Order The report row says fulfilled while the certificate status says pending; Track Order returns issued (live: 1125823297). Preferring certificateStatus reported the order as pending and never downloaded the certificate. That one shape (order maps issued, certificate maps pending) now maps to null so the sync asks Track Order, and the pair appears in UnmappedReportStatuses. Other disagreements keep their mapping.
FindSslComDomainAsync called GET /domains for every pending domain on every DCV attempt, so a pass over many orders under one domain repeated the same lookup. A per-pass cache (one per sync pass, one per Enroll/GetSingleRecord DCV call) keeps found rows and "no row"; failed lookups aren't cached and fall back to emSign as before. Only DomainId/validatedBy come from the cached row; DCV state is still read fresh per order. Sync processes rows sequentially, so a plain dictionary.
…entry Command fails the Keyfactor-Enroll workflow step at its global Workflow Step Run Timeout (Workflow.General.Timeout, 60 s by default; the step has no timeout of its own). The pickup budget (5 s + PickupRetries x PickupDelay, capped at 75 s) was counted from the start of the pickup, so the create time came on top: on the lab a new DV order and a reissue (26 s) both reached Command's 60 s, which recorded a failure while the order went on at CERTInext. New setting EnrollmentCallBudgetSeconds (default 50, 0 disables, clamped to 90 under the 100 s HttpClient timeout). Enroll starts an EnrollmentDeadline, carried in an AsyncLocal to the V1 new/renew and V2 pickups. They shorten waits to keep a 3 s poll margin, skip the delay after the last poll, and stop with one Information line when no poll fits. In-flight calls are never cut short; PickupRetries=0 is unchanged; inline DCV is not bounded (documented as a known limitation).
…prover' order Opt-in (CERTINEXT_V2_FULFILLED_PENDING_SYNC=1), read-only. A DispatchProxy narrows the real report listing to one order and forwards every other call to the real client, so the actual Synchronize path runs live. Asserts the row defers to Track Order, comes out issued, and has its certificate download attempted. Live 2026-11-15 on 1125823297: Track issued, download 422 EMS-1165 (never generated), emitted issued without a body.
… its certificate isn't generated Live on 1125823297: Track Order says issued, but Download Certificate answers 422 EMS-1165 for an order placed months before the sandbox stopped generating, so the report's 'Pending for Approver' was right. Such a row (Track fallback said issued, the report's certificate status maps to pending, download EMS-1165) is now emitted pending instead of issued without a certificate. The download is still tried every pass, so a certificate that appears is imported. Other download failures, and rows whose report doesn't say pending, keep the issued-without-body behaviour.
…certificate and a pending certificate state Matches the V2 sync rule: Track says issued, Download Certificate answers 422 EMS-1165, and the order's certificateState (same text as the report's certificateStatus: Pending for Approver, Approved by System, Order Accepted) maps to pending, so the record is pending rather than issued without a body. An unrecognized or non-pending state, and other download failures, keep the existing result. Docs no longer claim the plugin never acts on certificateState.
… certificate and a pending state Opt-in with CERTINEXT_V2_FULFILLED_PENDING_SYNC=1, read-only, DCV off; orders from CERTINEXT_V2_SINGLE_RECORD_ORDERS. Also relaxes nothing in the sync test, which now expects pending without a body. Live 2026-11-16: 1125823297 (Pending for Approver) and 6292373831 (Approved by System) both returned pending (90); the one-order sync emitted 1125823297 pending.
…sign synced certificates a template The gateway gives a synced record a certificate profile only when its ProductID equals a configured template's ProductID (a GetProductIds() name) exactly (Gateway-AnyCA-REST CertificateService.CreateOrUpdateDBCertificate, called only from CASyncJob). Both syncs sent CERTInext product codes, which never matched: all 927 sync-created lab rows had no profile, and those certificates reached Command with no template. Each V1/V2 sync pass now reads the account catalog once (on first use) and names a code by productTypeID via the inverse of ProductTypeIdsV2. No fixed code table: the V1-era DefaultProductCodes would label the sandbox's DV 842 'OV SSL'. Unknown codes, types with no plugin product, and an unreadable catalog (one warning) keep the code. The sync summaries gain ProductNames Resolved/Unresolved. GetSingleRecord is unchanged: the gateway doesn't use its ProductID for the mapping. Includes a read-only catalog probe (V1 and V2 catalogs are identical on the sandbox).
…ad-only) Explains why a gateway row isn't re-saved by the sync. Opt-in with CERTINEXT_SYNC_PRODUCTID_PROBE=1 and CERTINEXT_PROBE_ORDERS. Live 2026-11-16: the 8 gateway rows still pending without a profile are all 'Order Cancelled | Rejected due to Order Cancellation' (Track: cancelled), which the sync skips.
… still holds it as pending Both syncs skip orders cancelled or rejected at CERTInext, and the gateway changes a row only when the sync emits a record for it, so an order it held as pending stayed pending indefinitely (8 kfclab rows, all 'Order Cancelled | Rejected due to Order Cancellation', Track: cancelled). Before skipping, the sync now asks the gateway (ICertificateDataReader.GetStatusByRequestID): held as pending -> emit failed with no certificate, once. No row (ArgumentException), already terminal, issued/revoked (never downgraded), no reader, or a lookup error keep the skip. Summaries gain FailedPropagated. Issue 0098.
…ildcard CN A DV/OV request with CN = apex and SAN = *.apex failed with EMS-1173: the wrapper keys "wildcard" on certificate.domain alone and resolved a plain UCC product. Sending the wildcard as the domain is rejected too (EMS-1056, the domain must match the CSR CN). Both confirmed live. With no template ProductCode, the plugin now reads the catalog and sends the account's single active Wildcard UCC product (typeID 21 DV / 22 OV) as X-Product-Code. No match, several matches, a catalog failure, or EV fails before any order is placed, asking for ProductCode. Adds unit coverage and an opt-in live probe (CERTINEXT_V2_WILDCARD_SAN_PROBE).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enrollment now stops waiting before Command's workflow timeout. Sync handles one more report status pair, and DCV caches SSL.com domain lookups.
Features
EnrollmentCallBudgetSeconds:0turns it off, maximum 90.Enrollstarts a deadline, and the pickup shortens its waits to fit.EnrollorGetSingleRecordDCV call.Fixes
Order Fulfilled | Pending for Approver:GetSingleRecorduses the same rule. That also coversApproved by System.Chores
EnrollmentCallBudgetSeconds. Inline DCV is listed under Known Limitations.Clock(TimeProvider) andPickupDelayAsync.Testing
DcvSupport=false.Other